﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Dispatcher;
using System.Text;

namespace WCFTest
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的类名“Service1”。
    public class Service1 : IService1
    {
        public string GetData(int value)
        {
            return string.Format("You entered: {0}", value);
        }

        public CompositeType GetDataUsingDataContract(CompositeType composite)
        {
            if (composite == null)
            {
                throw new ArgumentNullException("composite");
            }
            if (composite.BoolValue)
            {
//                composite.CurrentMillSeconds = DateTime.Now.Millisecond.ToString();
                composite.StringValue += "Suffix";
//                composite.CurrentName = "ABC";
            }
            return composite;
        }

        string IService1.GetCurrentTime(string format = null)
        {
            return string.IsNullOrWhiteSpace(format) ? null : DateTime.Now.ToString(format);
        }

        string IService1.GetTimeTicks()
        {
            return DateTime.Now.Ticks.ToString();
        }

         void IService1.WriteTime()
        {
             Console.WriteLine("a");
        }
    }
}
